package com.hcj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hcj.pojo.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    // 根据 category 来查询商品信息
    @Select("select * from product where cid = (select id from category where name = #{name}) ")
    List<Product> selectByCategory(String name);

}
